// 统一管理班级相关请求接口方法
// 引入自己封装的axios方法
import request from "@/utils/request";
import type { classAllResponseData, classInfoData, classListFormData, classListResponseData, classResponseData } from "./type";
// 请求地址枚举
// @ts-ignore
enum API{
    CLASS_ALL_URL="/manage/class/all",
    CLASS_LIST_URL="/manage/class/list",
    CLASS_ADD_URL="/manage/class/add",
    CLASS_GET_ID_URL="/manage/class/find",
    CLASS_UPDATE_URL="/manage/class/update",
    CLASS_DELETE_URL="/manage/class/delete",
}
// 获取所有班级
export const reqClassAll =()=>request.get<any,classAllResponseData>(API.CLASS_ALL_URL)
// 分页获取所有班级
export const reqClassList =(data:classListFormData)=>request.post<any,classListResponseData>(API.CLASS_LIST_URL,data)
// 添加班级
export const reqClassAdd=(data:classInfoData)=>request.post<any,classResponseData>(API.CLASS_ADD_URL,data)
// 查找所有班级信息（通过id）
export const reqClassById =(_id:string)=>request.get<any,classResponseData>(API.CLASS_GET_ID_URL+`?_id=${_id}`)
// 修改班级信息
export const reqClassUpdata =(data:classInfoData)=>request.post<any,classResponseData>(API.CLASS_UPDATE_URL,data)
// 删除班级
export const reqClassDelete =(classId:string)=>request.post<any,classResponseData>(API.CLASS_DELETE_URL,{classId})